Skip to content

Surface Book 3: Add thermal sensors and fans (main and base) - #190

Merged
qzed merged 5 commits into
linux-surface:v7.3-surface-develfrom
larsschellhas:sb3-tmp-fan-nodes
Nov 17, 2026
Merged

qzed merged 5 commits into
linux-surface:v7.3-surface-develfrom
larsschellhas:sb3-tmp-fan-nodes

Conversation

@larsschellhas

@larsschellhas larsschellhas commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

The Surface Book 3 has thermal sensors and a fan speed interface on its EC, but its registry node group doesn't list them, while newer devices already do. The base has its own thermal sensors and two fans, on the KIP (keyboard and peripheral controller) target. So far surface_temp and surface_fan only match SAM.

This PR has five commits:

  1. Registry: thermal sensors and fan speed (ssam:01:03:01:00:02, ssam:01:05:01:01:01), the same nodes as on the newer devices. surface_temp and surface_fan then bind.
  2. surface_temp: match entry for KIP (SSAM_SDEV(TMP, KIP, 0x00, 0x02)). A device only gets a TMP node on KIP if the registry lists one for it, so this changes nothing for other devices. For example, the Pro 8 type cover is on KIP too, but has no TMP node.
  3. Registry: base thermal sensors (ssam:01:03:02:00:02), below the base hub like the other base devices. They go away on detach and come back on attach.
  4. surface_fan: match entries for KIP, instances 1 and 2. Same reasoning as 2.
  5. Registry: base fans (ssam:01:05:02:01:01, ssam:01:05:02:02:01), also below the base hub.

Testing (Surface Book 3 15", i7-1065G7, kernel 7.2.15-1-surface): I registered the same nodes from an out-of-tree module, the base nodes below the base hub. For commits 2 and 4, I built surface_temp and surface_fan from the 7.2 sources with the extra match entries.

  • Main sensors: surface_temp exposes the nine sensors (I_RTS1–I_RTS8, I_VTS1, names reported by the EC). They match the raw EC readings through the SSAM cdev.
  • Fan: surface_fan reports the fan speed.
  • Base fans: with the KIP entries, surface_fan binds to both base fans. They report 0 rpm at idle. Under dGPU load (about 60 W), the raw EC readings through the SSAM cdev showed both at about 2700 rpm after roughly two minutes, at a GPU temperature of 86 °C. The NVIDIA driver itself reports 0 % fan.
  • Base sensors: with the KIP entry, a second surface_thermal device appears below the base hub with the base's nine sensors. Right after a CPU and GPU load run, the values were plausible: main I_VTS1 42.7 °C, base I_VTS1 30.7 °C.
  • Not tested: I haven't booted a kernel built with these patches, only the equivalent modules, and I haven't detached the base with the registry version. checkpatch.pl --strict reports no errors, warnings or checks for any of the five commits.

Something to be aware of: both thermal hwmon devices are called surface_thermal and report the same sensor names, because the EC provides those names. The three fans are all surface_fan. They can be told apart by the device path (…/01:03:01:00:02 vs. …/00:00:01:11:00/01:03:02:00:02). If you'd prefer different hwmon names or labels for the base, I can change that.

The fan maximum already follows the platform profile on this device (about 6000–8000 rpm from low-power to performance), so the platform profile node stays without has_fan. I also sent the fan profile command that has_fan adds (FAN cid 0x0e, values 1–4) under load. The EC accepts it, but neither the fan maximum nor the ramp changes.

Why the base sensors matter: on Windows, the Surface power management (SMF) regulates on the skin sensors. The main I_VTS1 limits the CPU, and the base I_VTS1 limits the dGPU. A user-space implementation of the same behaviour is in progress (linux-surface/linux-surface#2383), and on the SB3 it now reproduces the Windows CPU limits under load. Background and measurements: #117.

Once this is accepted here, I'd be glad to help get it upstream as well. Mainline's SB3 node group has the same gap.

The analysis, the test modules and the changelogs were prepared with the help of an AI coding assistant (Claude, Anthropic). I reviewed the changes and tested them on the device as described.

…eed for Surface Book 3

The Surface Book 3 EC provides the same thermal sensor (TMP, function 2)
and fan speed (FAN, instance 1) interfaces as the newer devices that
already list them, but the Surface Book 3 node group does not include
them. Add both nodes so that surface_temp and surface_fan can bind.

Tested on a Surface Book 3 (15", i7-1065G7) by registering the same two
nodes from an out-of-tree module: surface_temp exposes the nine EC
sensors (I_RTS1 to I_RTS8 and I_VTS1, names reported by the EC) and
surface_fan reports the fan speed. The values match the raw EC readings
obtained through the SSAM cdev.

The fan maximum already follows the platform profile on this device
(about 6000 to 8000 rpm from low-power to performance), so keep the
platform profile node without the has_fan property.

The analysis, the out-of-tree test module and this changelog were
prepared with the help of an AI coding assistant (Claude, Anthropic).
I reviewed the change and tested it on the device as described above.

Link: linux-surface#117
Signed-off-by: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
On the Surface Book 3, the base (keyboard and peripheral controller, KIP)
has its own set of thermal sensors behind the same TMP interface as the
ones on the main controller (SAM). Add a match entry for the KIP target
so that the driver can bind to such a node.

Devices only get a TMP node on the KIP target if the registry lists one
for them, so this does not change anything for other devices.

Tested on a Surface Book 3 (15", i7-1065G7) with the registry node from
the next patch, registered from an out-of-tree module: the driver binds
and exposes the nine base sensors (I_RTS1 to I_RTS8 and I_VTS1, names
reported by the EC).

The analysis, the out-of-tree test module and this changelog were
prepared with the help of an AI coding assistant (Claude, Anthropic).
I reviewed the change and tested it on the device as described above.

Link: linux-surface#117
Signed-off-by: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
…urface Book 3

The Surface Book 3 base provides a second set of thermal sensors on the
KIP target. Add the node below the base hub, like the other base
devices, so that it is removed when the clipboard is detached and added
again on attach, and so that surface_temp can bind to it.

On Windows, the skin temperature of the base (I_VTS1 on KIP) is the
input of the power management loop that limits the dGPU.

Tested on a Surface Book 3 (15", i7-1065G7) by registering the same node
below the base hub from an out-of-tree module, together with the
surface_temp match entry from the previous patch: a second
surface_thermal hwmon device appears with the nine base sensors. Both
hwmon devices report the same sensor names, as provided by the EC; they
can be told apart by their device path.

The analysis, the out-of-tree test module and this changelog were
prepared with the help of an AI coding assistant (Claude, Anthropic).
I reviewed the change and tested it on the device as described above.

Link: linux-surface#117
Signed-off-by: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
The Surface Book 3 base (keyboard and peripheral controller, KIP) has
two fans of its own, with the same FAN interface as the fan on the main
controller (SAM), on instances 1 and 2. Add match entries for them so
that the driver can bind to such nodes.

Devices only get FAN nodes on the KIP target if the registry lists them,
so this does not change anything for other devices.

Tested on a Surface Book 3 (15", i7-1065G7) with the registry nodes from
the next patch, registered from an out-of-tree module: the driver binds
to both base fans. They report 0 rpm at idle; under dGPU load, the raw
EC readings through the SSAM cdev showed both fans at about 2700 rpm
after roughly two minutes.

The analysis, the out-of-tree test module and this changelog were
prepared with the help of an AI coding assistant (Claude, Anthropic).
I reviewed the change and tested it on the device as described above.

Link: linux-surface#117
Signed-off-by: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
The Surface Book 3 base has two fans on the KIP target (instances 1 and
2), which start up under dGPU load. Add their fan speed nodes below the
base hub, like the other base devices, so that surface_fan can bind to
them.

Tested on a Surface Book 3 (15", i7-1065G7) by registering the same
nodes below the base hub from an out-of-tree module, together with the
surface_fan match entries from the previous patch: two more surface_fan
hwmon devices appear for the base fans.

The analysis, the out-of-tree test module and this changelog were
prepared with the help of an AI coding assistant (Claude, Anthropic).
I reviewed the change and tested it on the device as described above.

Link: linux-surface#117
Signed-off-by: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>
@larsschellhas larsschellhas changed the title platform/surface: aggregator_registry: Add thermal sensors and fan speed for Surface Book 3 Surface Book 3: Add thermal sensors and fans (main and base) Nov 15, 2026
@larsschellhas

Copy link
Copy Markdown
Contributor Author

Friendly ping. I re-checked the impact on other models:

  • The new nodes are only in the SB3 group (MSHW0117). The KIP match entries in surface_temp/surface_fan only bind to those nodes, so other models see no change and no new requests.
  • Open point: the 13.5" SB3 shares MSHW0117. Its Windows power config reads the main and base temperature sensors, so the TMP nodes should be fine there. Its fans I can't confirm: if a 13.5" variant has no main or base fan, reads of that fan1_input would time out. surface_fan sends nothing at probe, only on read.

Options: keep it as is and ask a 13.5" owner to test, or let surface_fan read once at probe and drop the device if there is no answer. What do you prefer?

@qzed

qzed commented Nov 17, 2026

Copy link
Copy Markdown
Member

Thanks!

Something to be aware of: both thermal hwmon devices are called surface_thermal and report the same sensor names, because the EC provides those names. The three fans are all surface_fan. They can be told apart by the device path (…/01:03:01:00:02 vs. …/00:00:01:11:00/01:03:02:00:02).

I think that should be fine. Unless there's something that requires different names, but at the moment I'm not aware of anything.

Open point: the 13.5" SB3 shares MSHW0117. Its Windows power config reads the main and base temperature sensors, so the TMP nodes should be fine there. Its fans I can't confirm: if a 13.5" variant has no main or base fan, reads of that fan1_input would time out. surface_fan sends nothing at probe, only on read.

I think let's maybe try and merge this. If we see some fallout (e.g. timeouts, zero readings) we have to check if there's any way to detect the 13.5 variant or the number of fans (similar to number of thermal sensors). But that might be easier to fix once we have it in the packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants